//
//  NewsViewCell.m
//  项目一TimeMovie
//
//  Created by apple on 16/3/31.
//  Copyright © 2016年 huangmingyu. All rights reserved.
//

#import "NewsViewCell.h"

@implementation NewsViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(NewsModel *)model {
    
    _model = model;
    
    _TitleLabel.text = _model.titleLabel;
    _SummaryLabel.text = _model.summaryLabel;
    [_TitleImageView sd_setImageWithURL:[NSURL URLWithString:_model.image] placeholderImage:[UIImage imageNamed:@"pig"]];
    
    NSString *imageName;
    switch (_model.newsTpye) {
        case WordType:
            imageName = nil;
            break;
        case ImageType:
            imageName = @"sctpxw";
            break;
        case VideoType:
            imageName = @"scspxw";
            break;
        default:
            break;
    }
    _TypeImageView.image = [UIImage imageNamed:imageName];
    
}

@end
